package xs.szw.service.controller.menu;

import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import xs.szw.common.result.Result;
import xs.szw.service.model.vo.RouteVO;
import xs.szw.service.service.MenuService;

import java.util.List;

import static xs.szw.common.result.Result.success;

/**
 * @program: xs_oa
 * @description:
 * @author: Songzw
 * @create: 2025-02-11 10:36
 **/
@Tag(name = "菜单管理")
@RestController
@RequestMapping("/sys/menus")
@Slf4j
@RequiredArgsConstructor
public class MenuController {


    private final MenuService menuService;

    @GetMapping("/routes")
    @Operation(summary = "获取当前用户菜单路由列表")
    public Result<List<RouteVO>> getCurrentUserRoutes(){
        List<RouteVO> list = menuService.getCurrentUserRoutes();
        return success(list,"获取当前用户菜单路由列表");
    }

}
